package com.rankeiot.platform.domain;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.experimental.FieldNameConstants;
import org.hibernate.validator.constraints.Length;
import org.sagacity.sqltoy.config.annotation.Column;
import org.sagacity.sqltoy.config.annotation.Entity;
import org.sagacity.sqltoy.config.annotation.Id;

import java.io.Serializable;
import java.sql.Types;
import java.util.Date;

@Schema(description ="短信消息")
@Data
@FieldNameConstants(asEnum = true)
@Entity(tableName= SmsMessage.TABLE)
public class SmsMessage implements Serializable {
    public static final String TABLE="t_sms_message";
    /**
     * ID
     */
     @Schema(description ="ID")
    @Id(strategy = "identity")
    @Column(name="id",length=10L,type=Types.INTEGER,nullable=false,autoIncrement = true)
    private Integer id;
    /**
     * 发送号码
     */
    @Schema(description ="手机号码")
    @NotNull
    @Length(max=20)
    @Column(name="phone_number",length=20L,type=Types.VARCHAR,nullable=false)
    private String phoneNumber;
    /**
     * 模板签名
     */
     @Schema(description ="模板签名")
    @NotNull
    @Length(max=20)
    @Column(name="sign_name",length=20L,type=Types.VARCHAR,nullable=false)
    private String signName;
    /**
     * 发送模板编号
     */
     @Schema(description ="模板编号")
    @NotNull
    @Length(max=20)
    @Column(name="template_code",length=20L,type=Types.VARCHAR,nullable=false)
    private String templateCode;

    /**
     * 模板参数
     */
     @Schema(description ="模板参数")
    @Length(max=255)
    @Column(name="template_param",length=255L,type=Types.VARCHAR)
    private String templateParam;
    /**
     * 发送时间
     */
     @Schema(description ="发送时间")
    @Column(name="create_time",length=19L,type=Types.TIMESTAMP)
    private Date createTime;
    /**
     * 发送人
     */
    @Schema(description = "发送人")
    @Length(max=100)
    @Column(name="create_user",length=100L,type=Types.VARCHAR)
    private String createUser;
    /**
     * 发送状态
     */
     @Schema(description ="发送状态")
    @Length(max=10)
    @Column(name="status",length=10L,type=Types.VARCHAR)
    private String status;
    /**
     * 说明
     */
     @Schema(description ="说明")
    @Length(max=255)
    @Column(name="memo",length=255L,type= Types.VARCHAR)
    private String memo;

    public SmsMessage(){}
    public SmsMessage(Integer id){
        this.id=id;
    }
}
